using UnityEngine;
using UnityEditor;
using System.Collections;
//////////////////////////////////////////////////////
///将选中的GameObject重新连接Prefab.
//////////////////////////////////////////////////////
public class ReconnectPrefabs : MonoBehaviour {
	
	[MenuItem("Level4/Other/ReconnectPrefab")]
	static void Init(){
		GameObject[] gos = Selection.gameObjects;
		if(gos.Length > 0){
			// Undo.RegisterSceneUndo("ReconnectPrefabs");
			Undo.RecordObjects(gos,"ReconnectPrefab");
			
			foreach(GameObject go in gos){
				PrefabUtility.ReconnectToLastPrefab(go);
			}
			Debug.Log("ok"+gos.Length);
		}
	}
}
